<script setup lang="ts">
const obj = { a: 1, b: '2' }
// {a: number, b: string}
type MyObj = typeof obj
// keyof MyObj 'a' | 'b'
// [P in 'a' | 'b'] => P遍历 "a", "b"
// T[P] => T对象类型 a属性 b属性 T['a'] => a的类型 T['b'] => b类型

// type PObj = Partial<MyObj>
type MyPartial<T> = {
  [S in keyof T]?: T[S]
}
// 假设一个对象里的类型 a:number b:string => {a: [number, number, number], b: [string, string, string]}
type PObj = MyPartial<MyObj>

type MapObj<T> = {
  [P in keyof T]: [T[P], T[P], T[P]]
}
type TestMapObj = MapObj<MyObj>
</script>

<template>
  <div class="playground-page">
    <h1>playground-综合练习</h1>
  </div>
</template>

<style scoped lang="scss"></style>
